using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QuanLyKhachHang.BUS
{
	#region using
	using System.Data;
	using QuanLyKhachHang.DAO;
	using QuanLyKhachHang.DTO;
	#endregion
	public class KH_TIEMNANGBUS
	{
		private KH_TIEMNANGDAO objDAO;
		public KH_TIEMNANGBUS(String strPath)
		{
			objDAO = new KH_TIEMNANGDAO(strPath);
		}

		public DataSet SelectAll()
		{
			DataSet ds;
			try
			{
				ds = objDAO.SelectAll();
				return ds;
			}
			catch(System.Exception e)
			{
				throw new Exception(e.Message, e.InnerException);
			}
		}

        public DataSet SelectByID(string stt, int thang, int nam)
        {
            DataSet ds;
            try
            {
                ds = objDAO.SelectByID(stt, thang, nam);
                return ds;
            }
            catch (System.Exception e)
            {
                throw new Exception(e.Message, e.InnerException);
            }
        }

        public bool Insert(KH_CO_SD_TIEMNANGDTO obj, KH_TIEMNANGDTO objtn)
		{
			try
			{
				return objDAO.Insert(obj, objtn);
			}
			catch
			{
				return false;
			}
		}

        public DataSet SelectByMADONVITHANGNAM(string madonvi, int thang, int nam)
        {
            DataSet ds;
            try
            {
                ds = objDAO.SelectByMADONVITHANGNAM(madonvi, thang, nam);
                return ds;
            }
            catch (System.Exception e)
            {
                throw new Exception(e.Message, e.InnerException);
            }
        }

		public bool Delete(string stt)
		{
			try
			{
				return objDAO.Delete(stt);
			}
			catch
			{
				return false;
			}
		}

		public bool Update(KH_TIEMNANGDTO obj)
		{
			try
			{
				return objDAO.Update(obj);
			}
			catch
			{
				return false;
			}
		}

	}
}